<?php
/**
 * 
 * @author ferd
 *
 */
class Accounting {
	
	private static $_instance;
	
	private function __construct(){
		// transaction item type
		define("DEBIT",0);
		define("CREDIT",1);
		
		define("ENABLED",0);
		define("DISABLED",1);
	}
	
	public static function get_instance(){
		if(!isset(self::$_instance)){
			self::$_instance = new Accounting();
		}
		return self::$_instance();
	}
	
	public function get_account($acct_id){
		return AccountingDb::get_instance()->get_account($acct_id);
	}
	
	public function get_accounts($match){
		return AccountingDb::get_instance()->get_accounts($match);
	}
	
	public function add_transaction($transaction){
		if($transaction instanceof Transaction){
			 // TODO
		} else {
			throw new Exception("Invalid argument");
		}
	}
}